// 函数组合 调试
// NEVER SAY DIE -->  never-say-die
const _ = require('lodash')
const str = 'NEVER SAY DIE'
const log = _.curry((tag, v) => {
    console.log(tag, v);
    return v
})
const split = _.curry((sep, str) => _.split(str, sep))
const join = _.curry((sep, array) => _.join(array, sep))
const map = _.curry((fn, array) => _.map(array, fn))
const f = _.flowRight(log('toLower'), _.toLower, log('join'), join('-'), log('map'), map(_.toLower), log('split'), split(' '))
console.log(f(str));

// console.log(_.toUpper('sdfsdf'));

//  柯里化函数curry的实参，按前往后的顺序依次使用